<?php
class cls_data_cart extends cls_data_base
{
    function get_product_info($product_id)       /*输入产品id， 输出product表里的关于该产品的所有信息 */
	{
		$product_id=mysql_escape_string($product_id);
		$sql="select p.*,ps.quantity 
			  from product p 
			  	left join productstatistic ps on p.ID=ps.productID
		      where p.ID='{$product_id}'";
		$product_detail=$this->db->getrow($sql);
		return $product_detail;
	}
	
	function get_product_discount($product_id)
	{
		$product_id=mysql_escape_string($product_id);
		$sql="select d.* from
		discountproduct dp,discount d
		where d.ID = dp.DiscountID and dp.productid='{$product_id}'";
		$product_discount=$this->db->getrow($sql);
		return $product_discount;
	}
	
	
}